import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '../views/layout/Layout.vue'
import Home from '../views/home/Home.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      // 布局
      path: '/',
      component: Layout,
      children: [
        {
          // 首页
          path: '/',
          component: Home,
        },
        {
          // 一级分类菜单
          path: 'partner',
          component: () => import('../views/partner/Partner.vue'),
          children: [
            {
              // 二级功能菜单，展示功能页面
              path: 'order',
              component: () => import('../views/partner/order/Order.vue'),
            },
            {
              path: 'view',
              component: () => import('../views/partner/order/View.vue'),
            }
          ]
        },
        {
          path: 'extend',
          component: () => import('../views/partner/Partner.vue'),
          children: [
            {
              path: 'function',
              component: () => import('../views/extend/function/Function.vue')
            }
          ]
        }
      ]
    }
  ]
})


export default router
